package Example4.Example17;
class Animal{
    public void shout(){
        System.out.println("动物叫......");
    }
}
class Dog extends Animal{
    public void shout(){
        System.out.println("汪汪......");
    }
    public void eat(){
        System.out.println("吃骨头......");
    }
}
public class Example17 {
    public static void main(String[] args) {
        Animal al=new Dog();
        System.out.println("Animal al=new Dog():"+(al instanceof Animal));
        System.out.println("Animal al.shout():"+(al instanceof Dog));
        Animal a2=new Dog();
        System.out.println("Animal a2=new Dog():"+(a2 instanceof Animal));
        System.out.println("Animal a2.shout():"+(a2 instanceof Dog));
    }
}
